package com.baosight.sczx.zm.cc.service; 
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.threadlocal.UserSession;
import com.baosight.iplat4j.ep.ServiceEPBase;
import com.baosight.sczx.common.zm.basetools.StaticTools;
import com.baosight.sczx.common.zm.cInterface.Department;
import com.baosight.sczx.common.zm.cInterface.cs.InitialData;
import com.baosight.sczx.zm.cc.domain.ZMCCProduceproblemHandleProcess_x; 
/**
 * 生产问题处理---过程记录
 */
public class ServiceZMCC13 extends ServiceEPBase {
	/**
	 * 初始化 
	 */
	public EiInfo initLoad(EiInfo inInfo) {
		inInfo.addBlock(EiConstant.resultBlock).set("showCount", "true");//如果不加这个，翻页的统计和显示是错误的
		EiInfo outInfo = this.query(inInfo); 
		return outInfo;
	}
	/**
	 * 查询
	 */
	public EiInfo query(EiInfo inInfo) {

		String keyId = inInfo.getString("fdKeyId");
		EiInfo outInfo = inInfo;
		if (keyId != null) {
			StaticTools.setQueryParameters(inInfo, "fdRecordId", keyId, true);
			outInfo = super.query(inInfo, "ZMCCProduceproblemHandleProcess_x.query", new ZMCCProduceproblemHandleProcess_x());
		} else {
			outInfo.addBlock("result").setBlockMeta(new ZMCCProduceproblemHandleProcess_x().eiMetadata);
		}

		outInfo.addBlock(Department.getInstance().getMiningDepts("cmes.cp.department", "orgCode", "orgName", false, UserSession.getInSessionProperty("miningCode").toString()));// 部门
		outInfo.addBlock(InitialData.getInstance().getEiBlockByNo("cmes.cl.penaltyType"));
		return outInfo;
	}
}
